package com.ceuer.pet.entity;

public class User {
	private Integer id;//用户id
	private Integer role;//角色(1:管理员;2:会员)
	private String mobile;//手机账户
	private String password;//密码
	private String name;//昵称
	private String regtime;//注册时间
	private String logintime;//登录时间
	private Integer status;//账户状态(1:正常 2:注销)
	private Integer enable;//是否启用(1:启用 2:禁用)
	
	//以下是非数据库映射属性---字段
	public String roleName;//自定义---角色名称
	public String statusName;//自定义---账户状态名称
	public String enableName;//自定义---是否启用名称
	
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder("User [");
		if (id != null)
			sb.append("            id=").append(id).append(",");
		if (role != null)
			sb.append("            role=").append(role).append(",");
		if (mobile != null)
			sb.append("            mobile='").append(mobile).append("',");
		if (password != null)
			sb.append("            password='").append(password).append("',");
		if (name != null)
			sb.append("            name='").append(name).append("',");
		if (regtime != null)
			sb.append("            regtime='").append(regtime).append("',");
		if (logintime != null)
			sb.append("            logintime='").append(logintime).append("',");
		if (status != null)
			sb.append("            status=").append(status).append(",");
		if (enable != null)
			sb.append("            enable=").append(enable).append(",");
		if (roleName != null)
			sb.append("            roleName='").append(roleName).append("',");
		if (statusName != null)
			sb.append("            statusName='").append(statusName).append("',");
		if (enableName != null)
			sb.append("            enableName='").append(enableName).append("',");
		sb.append("] ");
		sb.append(super.toString());
		return sb.toString();
	}
	
	public String getRoleName() {
		return roleName;
	}
	
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	
	public String getStatusName() {
		return statusName;
	}
	
	public void setStatusName(String statusName) {
		this.statusName = statusName;
	}
	
	public String getEnableName() {
		return enableName;
	}
	
	public void setEnableName(String enableName) {
		this.enableName = enableName;
	}
	
	public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	public Integer getRole() {
		return role;
	}
	
	public void setRole(Integer role) {
		this.role = role;
		if(this.role==1){
			this.roleName="管理员";
		}else{
			this.roleName="会员";
		}
	}
	
	public String getMobile() {
		return mobile;
	}
	
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	public String getPassword() {
		return password;
	}
	
	public void setPassword(String password) {
		this.password = password;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getRegtime() {
		return regtime;
	}
	
	public void setRegtime(String regtime) {
		this.regtime = regtime;
	}
	
	public String getLogintime() {
		return logintime;
	}
	
	public void setLogintime(String logintime) {
		this.logintime = logintime;
	}
	
	public Integer getStatus() {
		return status;
	}
	
	public void setStatus(Integer status) {
		this.status = status;
		if(status!=null){
			if(this.status==1){
				this.statusName="正常";
			}else if(this.status==2){
				this.statusName="注销";
			}
		}
	}
	
	public Integer getEnable() {
		return enable;
	}
	
	public void setEnable(Integer enable) {
		this.enable = enable;
		if(this.enable==1){
			this.enableName="启用";
		}else{
			this.enableName="禁用";
		}
	}
}